# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgbase=pango
pkgname=(
  pango
  pango-docs
)
pkgver=1.51.1
pkgrel=1
epoch=1
pkgdesc="A library for layout and rendering of text"
url="https://www.pango.org/"
arch=(loong64 x86_64)
license=(LGPL)
depends=(
  cairo
  fribidi
  harfbuzz
  libthai
  libxft
)
makedepends=(
  gi-docgen
  git
  gobject-introspection
  help2man
  meson
)
_commit=dfdbb8b55effc0feb72a1981944acaf20ee71354  # tags/1.51.1^0
source=("git+https://gitlab.gnome.org/GNOME/pango.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd pango
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd pango
}

build() {
  local meson_options=(
    -D gtk_doc=true
  )

  arch-meson pango build "${meson_options[@]}"
  meson compile -C build
}

# not running checks: validation breaks when deps
# (especially harfbuzz) don't match upstream CI

package_pango() {
  provides=(libpango{,cairo,ft2,xft}-1.0.so)

  meson install -C build --destdir "$pkgdir"

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

package_pango-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
